<template>

  <van-nav-bar title="demo1首页" left-text="主页" left-arrow @click-left="$router.push({ path: '/main' })"></van-nav-bar>
  <!--注意不要写成 <van-nav-bar/> 直接闭合的标签 渲染有问题 -->



  <van-tabs v-model:active="active">
    <van-tab title="标签 1">
      <test1></test1>
    </van-tab>
    <van-tab title="标签 2">
      <test2></test2>
    </van-tab>
    <van-tab title="标签 3">
      <test3></test3>
    </van-tab>
  </van-tabs>


  <van-tabbar v-model="active">
    <van-tabbar-item icon="home-o">标签</van-tabbar-item>
    <van-tabbar-item icon="search">标签</van-tabbar-item>
    <van-tabbar-item icon="friends-o">标签</van-tabbar-item>
    <van-tabbar-item icon="user-o">标签</van-tabbar-item>
  </van-tabbar>



</template>

<script>
  export default {
    setup() {
      //测试组合式API
      let { ref } = Vue
      const active = ref(0);
      return {
        active
      };
    },
    mounted() {
    },
    components: {
      //演示加载局部组件,还可以用路由加载
      test1: Vue.vloadc('/demo/demo1/test1.html'),
      test2: Vue.vloadc('/demo/demo1/test2.html'),
      test3: Vue.vloadc('/demo/demo1/test3.html'),
    },
    methods: {

    }
  }
</script>

<style scoped>

</style>